package com.nulgame.bukkit.plugin;

import java.io.File;

import junit.framework.TestCase;

import org.bukkit.configuration.file.YamlConfiguration;

import com.nulgame.bukkit.plugin.resource.Resource;

public class ConfigStreamTestCase extends TestCase {
	
	public void testConfigPath(){
		File configFile = new File(Resource.CUSTOM_FILE_NAME);
		YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
		
		assertTrue(config.contains("Options.AntiChatSpam"));
		assertTrue(config.contains("Options.AntiChatOverFlow"));
		assertTrue(config.contains("Options.AntiWord"));
		assertTrue(config.contains("Options.AntiWordCap"));
		assertTrue(config.contains("Options.AntiIPAddress"));
		assertTrue(config.contains("Options.AntiServerAddress"));
		
		assertTrue(config.contains("AntiChatSpam.InMillisTime"));
		assertTrue(config.contains("AntiChatSpam.AllowedInfraction"));
		assertTrue(config.contains("AntiChatSpam.ResponseToPlayer"));

		assertTrue(config.contains("AntiChatOverFlow.InMillisTime"));
		assertTrue(config.contains("AntiChatOverFlow.ResponseToPlayer"));
		
		assertTrue(config.contains("AntiWord.Words"));
		assertTrue(config.contains("AntiWord.ResponseToPlayer"));
		
		assertTrue(config.contains("AntiWordCap.AllowedPercentage"));
		assertTrue(config.contains("AntiWordCap.ResponseToPlayer"));
		
		assertTrue(config.contains("AntiIPAddress.ResponseToPlayer"));
		
		assertTrue(config.contains("AntiServerAddress.DomainType"));
		assertTrue(config.contains("AntiServerAddress.ResponseToPlayer"));
				
	}
}
